package com.dxb.demo;

import com.dxb.config.AnotherConfig;
import com.dxb.config.ChildConfig;
import com.dxb.config.FollowConfig;
import com.dxb.config.ParentConfig;
import com.dxb.config.BeforeConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 */
@Component
public class ConfigPrint implements ApplicationRunner {
    @Autowired
    private ParentConfig parentConfig;
    @Autowired
    private AnotherConfig anotherConfig;
    @Autowired
    private BeforeConfig beforeConfig;
    @Autowired
    private ChildConfig childConfig;
    @Autowired
    private FollowConfig followConfig;

    @Value("${com.dxb.config}")
    private String demo;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("demo:   " + demo);
        System.out.println("anotherConfig:  " + anotherConfig.getConfig());
        System.out.println("parentConfig:  " + parentConfig.getConfig());
        System.out.println("childConfig:  " + childConfig.getConfig());
        System.out.println("beforeConfig:  " + beforeConfig.getConfig());
        System.out.println("followConfig:  " + followConfig.getConfig());


    }
}
